<%= render :partial => "apo/navigation" %>

    <div id="content-pri-frame">

      <div id="content-pri-frame-gener">
    <% if session[:user].admin %>
        <% if flash[:notice] %>
            <h2><%= h flash[:notice] %></h2>
        <% end %>

        <% form_tag :action => "admin" do %>

            <div class="container" style="float: left;">
                <h5>Events</h5>

                <p class="smallerText" style="font-style: italic;"><%= link_to "View deleted events", :controller => :events, :action => :deleted %></p>
                <p class="smallerText" style="font-style: italic;"><%= link_to "View event logs", :controller => :events, :action => :logs %></p>

                <h5>SRC</h5>

                <p class="smallerText">To require everyone to read and sign the SRC again, <%= submit_tag "Reset SRC" %></p>

                <p class="smallerText">Toggle whether people need to sign the SRC <%= submit_tag "Toggle SRC" %></p>

                <p class="smallerText">SRC requirement is currently <%= h @srcToggle ? "on" :"off" %></p>

                <h5>Create a pledge class</h5>
                <%= text_field_tag "pledgeclass" %>
                <%= submit_tag "Create" %>

                <% if session[:user].admin? %>
                    <h5>Officer requirements</h5>

                    <div class="container">
                        <div class="cellRow cellRowHeader">
                            <div class="cellBlock">
                                Name
                            </div>
                            <div class="cellBlock">
                                Position
                            </div>
                            <div class="cellBlock">
                                Completed
                            </div>
                        </div>
                        <% @officers.each_with_index do |officer, index| %>
                            <% member = officer.member %>
                            <div class="cellRow cellRow<%= index % 2 + 1 %>">
                                <div class="cellBlock">
                                    <%= link_to h(member.full_name), :controller => :members, :action => :show, :id => member.id %>
                                </div>
                                <div class="cellBlock">
                                    <%= Position.getPosition(officer.position) %>
                                </div>
                                <div class="cellBlock" style="text-align: center">
                                    <%= link_to officer.completed ? "Yes" : "No", :controller => :positions, :action => :toggle_complete, :id => member.id %>
                                </div>
                            </div>
                        <% end %>
                    </div>
                <% end %>
            </div>

            <div class="container" style="float: right;">
                <h5>Members</h5>

                <p class="smallerText" style="font-style: italic;"><%= link_to "View deleted members", :controller => :members, :action => :deleted %></p>

                <p class="smallerText">If peoples' credits don't seem to be adding up, <%= submit_tag "Refresh members" %></p>

                <h5>Members with admin priviledges:</h5>

                <p class="smallerText">
                    <% @admin.each do |member| %>
                        <%= link_to h(member.full_name), :controller => :members, :action => :show, :id => member.id %>
                        <br>
                    <% end %>
                </p>
            </div>

        <% end %>
    <% else %>
        <h2 style="color: red;">You do not have permission to view this page.</h2>

        <h3> If you feel that you should have permission, please email internet@apouiuc.com </h3>
    <% end %>
</div>
</div>

<%= render :partial => "apo/footer" %>